IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
	LINK_DIRECTORIES(
		${LINK_DIRECTORIES}
		/opt/local/lib
		/usr/lib
	)

	IF(${TORRENT} MATCHES ON)
		SET(MACOSX_EXTRAS 
			${MACOSX_EXTRAS} 
			libtorrent/libtorrent.dylib
		)
	ENDIF(${TORRENT} MATCHES ON)

	IF(${BUILTIN_BROWSER} MATCHES ON)
		#SET(USE_WEBKIT ON)
		#IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
			#MESSAGE("Using wxWebKitCtrl instead of wxMoz")
		#ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
		#	SET(USE_WXMOZ shipped CACHE SRING "Select system or shipped wxMozilla library")
		#	IF(${USE_WXMOZ} MATCHES "shipped")
		#		SUBDIRS(mozembed)
		#		INCLUDE_DIRECTORIES(mozembed)
		#		SET(wxMoz_LIB mozembed)
		#	ELSE(${USE_WXMOZ} MATCHES "shipped")
		#		PKG_CHECK_MODULES(WXMOZ wxmozilla)
		#		INCLUDE_DIRECTORIES(
		#			${INCLUDE_DIRECTORIES}
		#			${WXMOZ_INCLUDE_DIRS}
		#		)
		#		LINK_DIRECTORIES(
		#			${LINK_DIRECTORIES}
		#			${WXMOZ_LIBRARY_DIRS}
		#		)
		#		SET(wxMoz_LIB "")
		#	ENDIF(${USE_WXMOZ} MATCHES "shipped")
		#IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    ENDIF(${BUILTIN_BROWSER} MATCHES ON)

	IF(${DOWNLOADER} MATCHES ON)
		SET(MACOSX_EXTRAS
			${MACOSX_EXTRAS} 
			wxCURL/libwxcurl.dylib
		)
	ENDIF(${DOWNLOADER} MATCHES ON)
	
    #IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    #    SET(MACOSX_EXTRAS_UPDATE webupdate/libwebupdate.dylib)
    #    SET(MACOSX_BUNDLE_INFO_STRING "")
    #    #SET(MACOSX_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/contrib/ddps-update.icns")
    #    SET(MACOSX_BUNDLE_GUI_IDENTIFIER "")
    #    SET(MACOSX_BUNDLE_LONG_VERSION_STRING "")
    #    SET(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}-Updater")
    #    SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "")
    #    SET(MACOSX_BUNDLE_BUNDLE_VERSION "${DDPS_UPDATE_VERSION}")
    #    SET(MACOSX_BUNDLE_COPYRIGHT "Copyright 2008 Sean Nelson")
    #    #SET_SOURCE_FILES_PROPERTIES(${MACOSX_EXTRAS_UPDATE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS)
    #ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

	
	SET(GUI_TYPE MACOSX_BUNDLE)
	SET(USE_WEBKIT ON)
	SET(MACOSX_BUNDLE_INFO_STRING "")
	SET(MACOSX_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/contrib/ddps2.icns")
	SET(MACOSX_BUNDLE_GUI_IDENTIFIER "")
	SET(MACOSX_BUNDLE_LONG_VERSION_STRING "")
	SET(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}")
	SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "")
	SET(MACOSX_BUNDLE_BUNDLE_VERSION "${DDPS_VERSION}")
	SET(MACOSX_BUNDLE_COPYRIGHT 
		"Copyright 2008 Sean Nelson, Corey Brown, Joshua Barron, Adam Troemne")
	#SET_SOURCE_FILES_PROPERTIES(${MACOSX_EXTRAS} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")